﻿@{
    ViewBag.Title = "编辑模板文件";
    int areas = ViewBag.Areas;
}
<form id="form1" url="TempletFileSave?pathName=@ViewBag.PathName&fileName=@ViewBag.FileName&areas=@areas">
    @Html.AntiForgeryToken()
    <div class="editTemplate">
        <dl>
            <dt>@(areas == 1 ? "Areas/Web/Views/" : "templates/")@ViewBag.PathName/@ViewBag.FileName</dt>
            <dd>
                @Html.TextArea("txtContent", ViewBag.Content as string, new { @class = "input", style = "width:100%;height:450px;" })
            </dd>
        </dl>
    </div>
    <!--/内容-->
    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-wrap">
            <button class="layui-btn icon-btn" id="btnSubmit"><i class="layui-icon layui-icon-ok"></i>提交保存</button>
            <input type="reset" name="btnReset" id="btnReset" class="layui-btn layui-btn-primary" value="重置" />
        </div>
    </div>
    <!--/工具栏-->
</form>
@section Scripts{
    <script type="text/javascript">
        layui.use(['validform', 'jqueryform','element', 'linedtextarea'], function () {
            var $ = layui.jquery;
            $("#form1").initValidform('#btnSubmit', 1);

            mainPageResize();
            $(window).resize(function () {
                //延迟执行,防止多次触发
                setTimeout(function () {
                    mainPageResize();
                }, 100);
            });

            //行号
            $("#txtContent").linedtextarea();

            //布局
            function mainPageResize() {
                var winHeight = $(window).height();
                $("#txtContent").height(winHeight - 100);
            }
        });
    </script>
}